import Mock from 'mockjs'
const grafes = Mock.mock({
  'items|10': [
    {
      'createTime': '@datetime("yyyy-MM-dd A HH:mm:ss")',
      'createUserId': '@id',
      'labelDesc': '@ctitle',
      'labelName': '@cname',
      'labelType|1': [0, 1, 2, 3],
      'updateTime': '@datetime("yyyy-MM-dd A HH:mm:ss")',
      'updateUserId': '@id'
    }
  ]
})
const items = Mock.mock({
  'list|10': [
    {
      'createTime': '@datetime("yyyy-MM-dd A HH:mm:ss")',
      'createUserId': '@id',
      'labelDesc': '@ctitle',
      'labelName': '@cname',
      'labelType|1': [0, 1, 2, 3],
      'updateTime': '@datetime("yyyy-MM-dd A HH:mm:ss")',
      'updateUserId': '@id'
    }
  ]
})
const pub = {
  isMore: 0,
  pageIndex: 1,
  pageSize: 10,
  startIndex: 0,
  totalNum: 30,
  totalPage: 1
}
const dictMap = {

}
export default [
  // 02-03-1根据id查询标签
  {
    url: '/elec/label/getLabelByid',
    type: 'get',
    response: config => {
      const tags = grafes.items[0]
      return {
        code: 1,
        data: {
          ...tags
        },
        dictMap: { ...dictMap },
        msg: ''
      }
    }
  },
  //   02-03-2分页查询标签集合
  {
    url: '/elec/label/getLabelListPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: { ...items, ...pub },
        dictMap: { ...dictMap },
        msg: '保存成功'
      }
    }
  },
  // 02-03-3根据参数查询标签
  {
    url: '/elec/label/getLabelList',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: items.items,
        dictMap: { ...dictMap },
        msg: ''
      }
    }
  },

  // 02-03-5修改保存标签
  {
    url: '/elec/label/modifyLabel',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: '修改成功'
      }
    }
  },
  // 02-03-6删除标签多个逗号分隔
  {
    url: '/elec/label/removeLabel',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: { },
        msg: ''
      }
    }
  },
  //   02-03-4新增保存标签
  {
    url: '/elec/label/saveLabel',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: { },
        msg: ''
      }
    }
  }
]
